package com.hue.concurrent.day01;

/*
    守护线程：
        守护线程会在所有非守护线程执行完毕后停止，不管守护线程的代码有没有执行完
 */
public class Demo13 {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            while (true){

            }
        });
        thread.setDaemon(true);
        thread.start();

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("main线程结束");
    }
}
